package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.CompanyInfo;
import com.ruoyi.system.domain.TAssociationClapDetail;
import com.ruoyi.system.domain.vo.handleRecord.HandleRecordVo;
import com.ruoyi.system.dto.handleRecord.HandleRecordDto;
import com.ruoyi.system.dto.handleRecord.IdSearchVO;
import com.ruoyi.system.service.IAssociationClapCulvertService;
import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName HandleRecordsController
 * @Author YangFu
 * @Date 2024/3/11 19:51
 * @Version 1.0
 */
@RestController
@RequestMapping("/app/handle/records")
@RequiredArgsConstructor
@Api(tags = {"(app)办理记录API"})
public class HandleRecordsController {

    private final IAssociationClapCulvertService associationClapCulvertService;

    @PostMapping("/notSubmitted")
    @ApiOperation(value = "办理记录")
    public AjaxResult<List<HandleRecordVo>> handleRecord(@RequestBody HandleRecordDto dto) {
        List<HandleRecordVo> vo = associationClapCulvertService.handleRecord(dto);
        return AjaxResult.success(vo);
    }

    @GetMapping("/getCompanyDesc")
    @ApiOperation(value = "查詢公司办理详情")
    public AjaxResult<CompanyInfo> getCompanyDesc(@ApiParam(value = "办事ID") @ModelAttribute IdSearchVO id) {
        CompanyInfo vo = associationClapCulvertService.getCompanyDesc(id.getId());
        return AjaxResult.success(vo);
    }
}
